<!DOCTYPE html>
<html xmlns="http://www.w3.org/1999/xhtml" xmlns:th="http://www.thymeleaf.org" >
	<head>
		<meta charset="utf-8" />
		<meta name="viewport" content="width=device-width, initial-scale=1.0">
		<title>Zuul网关路由系统</title>
		<!--<link rel="stylesheet" th:href="//maxcdn.bootstrapcdn.com/font-awesome/4.3.0/css/font-awesome.min.css">-->
		<link rel="stylesheet" th:href="@{/assets/css/amazeui.css}" />
		<link rel="stylesheet" th:href="@{/assets/css/core.css}" />
		<link rel="stylesheet" th:href="@{/assets/css/menu.css}" />
		<link rel="stylesheet" th:href="@{/assets/css/index.css}" />
		<link rel="stylesheet" th:href="@{/assets/css/admin.css}" />
		<link rel="stylesheet" th:href="@{/assets/css/page/typography.css}" />
		<link rel="stylesheet" th:href="@{/assets/css/page/form.css}" />
	</head>
	<body>
		<!-- Begin page -->
		<header class="am-topbar am-topbar-fixed-top">
			<div class="am-topbar-left am-hide-sm-only">
				<a href="index" class="logo">
					<span>网关管理系统</span>
					<i class="zmdi zmdi-layers"></i></a>
			</div>

			<div class="contain">
				<ul class="am-nav am-navbar-nav am-navbar-left">
					<li><h4 class="page-title">网关配置</h4></li>
				</ul>
				<ul class="am-nav am-navbar-nav am-navbar-right">
					<li class="inform"><i class="am-icon-bell-o" aria-hidden="true"></i></li>
					<li class="hidden-xs am-hide-sm-only">
						<form role="search" class="app-search">
							<input type="text" placeholder="Search..." class="form-control">
							<a href=""><img th:src="@{/assets/img/search.png}"></a>
						</form>
					</li>
				</ul>
			</div>
		</header>
		<!-- end page -->
		
		
		<div class="admin">
			<!--<div class="am-g">-->
		<!-- ========== Left Sidebar Start ========== -->
		<!--<div class="left side-menu am-hide-sm-only am-u-md-1 am-padding-0">
			<div class="slimScrollDiv" style="position: relative; overflow: hidden; width: auto; height: 548px;">
				<div class="sidebar-inner slimscrollleft" style="overflow: hidden; width: auto; height: 548px;">-->
                  <!-- sidebar start -->
				  <div class="admin-sidebar am-offcanvas  am-padding-0" id="admin-offcanvas">
				    <div class="am-offcanvas-bar admin-offcanvas-bar">
				    	<!-- User -->
						<div class="user-box am-hide-sm-only">
							<div class="user-img">
								<img th:src="@{/assets/img/banner-logo.jpg}" alt="user-img" title="Mat Helme" class="img-circle img-thumbnail img-responsive">
								<div class="user-status offline"><i class="am-icon-dot-circle-o" aria-hidden="true"></i></div>
							</div>
							<h5><a href="#">INFODB—ZUUL</a> </h5>
							<ul class="list-inline">
								<li>
									<a href="#">
										<i class="fa fa-cog" aria-hidden="true"></i>
									</a>
								</li>

								<li>
									<a href="#" class="text-custom">
										<i class="fa fa-cog" aria-hidden="true"></i>
									</a>
								</li>
							</ul>
						</div>
	                    <!-- End User -->

						<ul class="am-list admin-sidebar-list">
							<li><a th:href="@{/index}"><span class="am-icon-home"></span>首页</a></li>
							<li class="admin-parent">
								<a class="am-cf" data-am-collapse="{target: '#collapse-nav1'}"><span class="am-icon-table"></span>
									路由管理
									<span class="am-icon-angle-right am-fr am-margin-right"></span></a>
								<ul class="am-list am-collapse admin-sidebar-sub am-in" id="collapse-nav1">
									<li><a th:href="@{/list}" class="am-cf"> 路由列表</span></a></li>
									<li><a th:href="@{/save}" >扩展配置</a></li>
								</ul>
							</li>
							<li class="admin-parent">
								<a class="am-cf" data-am-collapse="{target: '#collapse-nav2'}"><i class="am-icon-line-chart" aria-hidden="true"></i> 统计图表 <span class="am-icon-angle-right am-fr am-margin-right"></span></a>
								<ul class="am-list am-collapse admin-sidebar-sub am-in" id="collapse-nav2">
									<li><a href="html/chart_line.html" class="am-cf"> 折线图</span></a></li>
									<li><a href="html/chart_columnar.html" class="am-cf"> 柱状图</span></a></li>
									<li><a href="html/chart_pie.html" class="am-cf"> 饼状图</span></a></li>
								</ul>
							</li>
							<li class="admin-parent">
								<a class="am-cf" data-am-collapse="{target: '#collapse-nav5'}"><span class="am-icon-file"></span> 表单 <span class="am-icon-angle-right am-fr am-margin-right"></span></a>
								<ul class="am-list am-collapse admin-sidebar-sub am-in" id="collapse-nav5">
									<li><a href="html/form_basic.html" class="am-cf"> 基本表单</a></li>
									<li><a href="form_validate.html">表单验证</a></li>
								</ul>
							</li>
						</ul>
				</div>
				  </div>
				  <!-- sidebar end -->
    
				<!--</div>
			</div>
		</div>-->
		<!-- ========== Left Sidebar end ========== -->
		
		
		
	<!--	<div class="am-g">-->
		<!-- ============================================================== -->
		<!-- Start right Content here -->
		<div class="content-page">
			<!-- Start content -->
			<div class="content">
				<div class="am-g">
					<!-- Row start -->
						<div class="am-u-sm-12">
							<div class="card-box">
								<ul class="am-nav am-fr">
								  <li class="am-dropdown" data-am-dropdown>
								    <a class="am-dropdown-toggle" data-am-dropdown-toggle href="javascript:;">
								       <span class="am-icon-caret-down"></span>
								    </a>
								    <ul class="am-dropdown-content">
								      <li>配置数据</li>
								    </ul>
								  </li>
								</ul>
								<form th:action="@{/route/save}" method="post" class="am-form" onsubmit="return CheckPost();" data-am-validator >
								<fieldset>
								    <legend>配置数据</legend>
								    <div class="am-form-group">
								      <label for="doc-vld-name-2">网关配置名称：</label>
								      <input type="text" id="doc-vld-name-2" name="name" minlength="1" placeholder="输入网关配置名称" required/>
								    </div>
								    <div class="am-form-group">
								      <label for="doc-vld-email-2">网关监控路径：</label>
								      <input type="text" id="doc-vld-email-2" name="path" placeholder="输入网关配置监控路径信息" />
								    </div>
								    <div class="am-form-group">
								      <label for="doc-vld-url-2">转发代理网址：</label>
								      <input type="url" id="doc-vld-url-2" name="url" placeholder="发代理网址" />
								    </div>
									<div class="am-form-group">
										  <label>是否截取前缀路径： </label>
										  <label class="am-radio-inline">
											  <input type="radio" value="yes" name="stripPrefix" > 是
										  </label>
										  <label class="am-radio-inline">
											  <input type="radio" value="no" name="stripPrefix" checked> 否
										  </label>
									</div>
								    <div class="am-form-group">
								      <label>是否启用过滤请求头： </label>
								      <label class="am-radio-inline">
								        <input type="radio" value="yes" name="customSensitiveHeaders" > 是
								      </label>
								      <label class="am-radio-inline">
								        <input type="radio" value="no" name="customSensitiveHeaders" checked> 否
								      </label>
								    </div>
								    <div class="am-form-group">
								      <label for="doc-vld-ta-2">请求头：</label>
								      <textarea id="doc-vld-ta-2" minlength="10" maxlength="120" name="sensitiveHeaders" placeholder="header的key之间采用','分割"></textarea>
								    </div>
									<div class="am-form-group">
										<label>是否启用状态： </label>
										<label class="am-radio-inline">
											  <input type="radio" value="yes" name="enabled"  checked>启用
										</label>
										<label class="am-radio-inline">
											  <input type="radio" value="no" name="enabled"> 禁用
										</label>
									</div>
								    <button id="save" class="am-btn am-btn-secondary" type="submit">提交</button>
								  </fieldset>
								</form>
							</div>
						</div>
					<!-- Row end -->
				</div>
			</div>
		</div>
		<!-- end right Content here -->
		<!--</div>-->
		</div>
		</div>
		<!-- navbar -->
		<a href="admin-offcanvas" class="am-icon-btn am-icon-th-list am-show-sm-only admin-menu" data-am-offcanvas="{target: '#admin-offcanvas'}"><!--<i class="fa fa-bars" aria-hidden="true"></i>--></a>
		<script type="text/javascript" th:src="@{/assets/js/jquery-2.1.0.js}" ></script>
		<script type="text/javascript" th:src="@{/assets/js/amazeui.min.js}"></script>
		<script type="text/javascript" th:src="@{/assets/js/app.js}" ></script>
		<script type="text/javascript" th:src="@{/assets/js/blockUI.js}" ></script>
		<script type="text/javascript" th:src="@{assets/js/base.js}"></script>
	</body>
	<script>

		function CheckPost(){
			var data  = {"name": $("#doc-vld-name-2").val(),"path":$("#doc-vld-email-2").val()};
			postRequest("route/validate",data,success,failure);
			return false;
		}

		//成功回调
		function success(result){
			window.location.href = "list";
		}
		//失败回调
		function failure(result){
			alert(result.message);
		}

		/*function buildPostData(){
			alert(1);
			return {"name": $("#doc-vld-name-2").val(),"path":$("#doc-vld-email-2").val(),"url":$("#doc-vld-url-2").val(),
				"stripPrefix":$("input[type='radio'][name='cut_prefix']:checked").val(),
				"customSensitiveHeaders":$("input[type='radio'][name='filter_header']:checked").val(),
				"enabled":$("input[type='radio'][name='enable_filter']:checked").val()};
		}

		$(function(){
			//操作
			$("#save").click(function(){
				alert(1);
				alert(buildPostData());
				postRequest("route/save",buildPostData(),success,failure);
			});
		});

		//成功回调
		function success(result){
			window.location.href = "list";
		}
		//失败回调
		function failure(result){
			alert(result.message);
		}*/
	</script>
</html>
